import torch

A = torch.arange(20).reshape(5, 4)   # 从0开始不包括最后一个数
B = A.clone()
hadamard_product = A * B
# product = torch.mm(A, B.reshape(4, -1))    # reshape不是转置
product = A @ B.T
print('A和B的Hadamard乘积为：\n', hadamard_product)
print('A和B的乘积为：\n', product)
